package com.test.pudamoney.activity_fragment_pudamoney.fragment_pudamoney;

import android.annotation.SuppressLint;
import android.os.Bundle;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.test.pudamoney.R;
import com.test.pudamoney.activity_fragment_pudamoney.base_pudamoney.BaseLoanFragment_pudamoney;
import com.test.pudamoney.bean_pudamoney.config_info_pudamoney.AppShowInfo_pudamoney;
import com.test.pudamoney.bean_pudamoney.process_pudamoney.ProcessInfo_pudamoney;
import com.test.pudamoney.util_pudamoney.http_pudamoney.HttpManager_pudamoney;


public class LoanFailFragment_pudamoney extends BaseLoanFragment_pudamoney {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_loan_fail_pudamoney, container, false);
        init_pudamoney(view);
        return view;
    }

    @SuppressLint("SetTextI18n")
    private void init_pudamoney(View view){

        TextView textTv = view.findViewById(R.id.fragment_loan_fail_tv_text);

        view.findViewById(R.id.fragment_loan_fail_btn_refresh_status).setOnClickListener(v -> HttpManager_pudamoney.getInstance().requestUserProcess());
        String days = ProcessInfo_pudamoney.getInstance().getDeniedBetweenDay();
        if (TextUtils.isEmpty(days)) days = AppShowInfo_pudamoney.getInstance().getRejectPeriod();
        textTv.setText(getString(R.string.fragment_loan_fail_text_1)+ days + getString(R.string.fragment_loan_fail_text_2));
    }
}